package com.zhang.publisher.mapper;

import com.zhang.publisher.bean.ProvinceStats;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @title: 地区统计Mapper接口
 * @author: zhang
 * @date: 2022/3/17 21:38
 */
public interface ProvinceStataMapper {

    //根据品牌维度统计某天商品交易额排名
    @Select(" select province_name,sum(order_amount) order_amount ,sum(order_count) order_count" +
            " from province_stats_2022  " +
            " where toYYYYMMDD(stt)=#{date} " +
            " group by province_name " +
            " order by order_amount desc ")
    List<ProvinceStats> selectProductStats(@Param("date") Integer date);

}
